package some.board.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import some.board.dao.BoardDao;
import some.board.domain.BoardCommand;
import some.board.validator.BoardDeleteValidator;

@Controller
public class DeleteController {
	@Autowired
	private BoardDao boardDao;
		
	@RequestMapping(value="/deleteBoard.do",method=RequestMethod.GET)
	public String form(@RequestParam("num") int num){

		boardDao.delete(num);
		
		return "redirect:/board.do";
	}
	
}
